<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>定时器任务</title>
  </head>
  <body></body>
  <script>
    //定时器模块工作就计时开始，时间一到就放到宏任务队列，哪个时间先到先放到队列
    // 同步任务一结束，没有其它微任务就输出，不会等到同步任务结束再计时
    setTimeout(() => {
      console.log("定时器1");
    }, 2000);
    setTimeout(() => {
      console.log("定时器2");
    }, 1000);
    console.log("后盾人");
    for (let i = 0; i < 10000; i++) {
      console.log(" ");
    }
  </script>
</html>
